package com.by.controller;

import com.by.bean.updateinventory;
import com.by.common.core.bean.ResultBean;
import com.by.common.core.controller.BaseController;
import com.by.service.SspecsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Api(tags = "库存管理")
public class SspecsController extends BaseController {
    @Autowired
    SspecsService ss;
    @GetMapping("/queryinventorylist")
    public ResultBean querylist(int goodsId){
        List  list =ss.querybygoodsid(goodsId);
        return success("查询成功",list);
    }
    @ApiOperation("修改库存")
    @PutMapping("/updateinventory")
    public  ResultBean updateinventorybyid(@RequestBody List<updateinventory> list){
        int re=ss.updateinventory(list);
        return updateResult(re);
    }



}
